define("MFilters",[],function () {
    var logger =function(originalFunc,scriptName,methodName){
        return function() {
            DEBUG("[call:"+scriptName +"."+methodName+"][args:"+JSON.stringify(arguments)+"]")
            var  script = originalFunc.apply(this, arguments);
            DEBUG("[call:"+scriptName +"."+methodName+"][return:"+JSON.stringify(script)+"]")
            return script;
        }
    }
    // var choiceDevice =function(originalFunc,scriptName,methodName){
    //     return function() {
    //         if(!isNull(this.target) && this.target.getType && this.target.getType()=="sdk" ){
    //             var device = serverCenter.getDeviceForService(scriptName);
    //             if(!isEmptyObject(device)){
    //                 var addr = "http://"+device.ip+":"+device.port+$current.contextPath+"/motor.json";
    //                 DEBUG("[CHOICE-DEVICE]["+addr+"]");
    //                 this.target.url = addr;
    //             }
    //         }
    //         return originalFunc.apply(this, arguments);
    //     }
    // }

    return [{
            matchName:/.*/,
            matchMethod:/.*/,
            matchType:/.*/,
            list:[logger]
        }];
});